﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;

namespace Admin.NET.Application;

/// <summary>
/// 货品表基础输入参数
/// </summary>
public class GoodsModelBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 货品编码
    /// </summary>
    [Required(ErrorMessage = "货品编码不能为空")]
    public virtual string GoodsCode { get; set; }
    
    /// <summary>
    /// 货品名称
    /// </summary>
    [Required(ErrorMessage = "货品名称不能为空")]
    public virtual string GoodsName { get; set; }
    
    /// <summary>
    /// 货品类型编号
    /// </summary>
    public virtual long? GoodsTypeId { get; set; }
    
    /// <summary>
    /// 货品规格型号
    /// </summary>
    public virtual string? GoodsSpecs { get; set; }
    
    /// <summary>
    /// 供应商编号
    /// </summary>
    public virtual long? GoodsSupplierId { get; set; }
    
    /// <summary>
    /// 客户编号
    /// </summary>
    public virtual long? GoodsCustomerId { get; set; }
    
    /// <summary>
    /// 入库参考价/元
    /// </summary>
    public virtual int? GoodsIntoMoney { get; set; }
    
    /// <summary>
    /// 出库参考价/元
    /// </summary>
    public virtual int? GoodsOutMoney { get; set; }
    
    /// <summary>
    /// 货品状态
    /// </summary>
    [Required(ErrorMessage = "货品状态不能为空")]
    public virtual bool? GoodsType { get; set; }
    
    /// <summary>
    /// 保质期管理
    /// </summary>
    [Required(ErrorMessage = "保质期管理不能为空")]
    public virtual bool? GoodsExpiration { get; set; }
    
    /// <summary>
    /// 保质期
    /// </summary>
    public virtual string? GoodsExpirationNum { get; set; }
    
    /// <summary>
    /// 预警天数
    /// </summary>
    public virtual int? GoodsWarning { get; set; }
    
    /// <summary>
    /// 货品备注
    /// </summary>
    public virtual string? GoodsNote { get; set; }
    
    /// <summary>
    /// 货品单位编号
    /// </summary>
    public virtual long? GoodsUnitId { get; set; }
    
    /// <summary>
    /// 货品图片
    /// </summary>
    public virtual string? GoodsPic { get; set; }
    
    /// <summary>
    /// 货品仓库编号
    /// </summary>
    public virtual long? GoodsWareId { get; set; }
    
}

/// <summary>
/// 货品表分页查询输入参数
/// </summary>
public class PageGoodsModelInput : BasePageInput
{
    /// <summary>
    /// 货品编码
    /// </summary>
    public string GoodsCode { get; set; }
    
    /// <summary>
    /// 货品名称
    /// </summary>
    public string GoodsName { get; set; }
    
    /// <summary>
    /// 货品类型编号
    /// </summary>
    public long? GoodsTypeId { get; set; }
    
    /// <summary>
    /// 货品规格型号
    /// </summary>
    public string? GoodsSpecs { get; set; }
    
    /// <summary>
    /// 供应商编号
    /// </summary>
    public long? GoodsSupplierId { get; set; }
    
    /// <summary>
    /// 客户编号
    /// </summary>
    public long? GoodsCustomerId { get; set; }
    
    /// <summary>
    /// 入库参考价/元
    /// </summary>
    public int? GoodsIntoMoney { get; set; }
    
    /// <summary>
    /// 出库参考价/元
    /// </summary>
    public int? GoodsOutMoney { get; set; }
    
    /// <summary>
    /// 货品状态
    /// </summary>
    public bool? GoodsType { get; set; }
    
    /// <summary>
    /// 保质期管理
    /// </summary>
    public bool? GoodsExpiration { get; set; }
    
    /// <summary>
    /// 保质期
    /// </summary>
    public string? GoodsExpirationNum { get; set; }
    
    /// <summary>
    /// 预警天数
    /// </summary>
    public int? GoodsWarning { get; set; }
    
    /// <summary>
    /// 货品备注
    /// </summary>
    public string? GoodsNote { get; set; }
    
    /// <summary>
    /// 货品单位编号
    /// </summary>
    public long? GoodsUnitId { get; set; }
    
    /// <summary>
    /// 货品图片
    /// </summary>
    public string? GoodsPic { get; set; }
    
    /// <summary>
    /// 货品仓库编号
    /// </summary>
    public long? GoodsWareId { get; set; }
    
    /// <summary>
    /// 选中主键列表
    /// </summary>
     public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 货品表增加输入参数
/// </summary>
public class AddGoodsModelInput
{
    /// <summary>
    /// 货品编码
    /// </summary>
    [Required(ErrorMessage = "货品编码不能为空")]
    [MaxLength(64, ErrorMessage = "货品编码字符长度不能超过64")]
    public string GoodsCode { get; set; }
    
    /// <summary>
    /// 货品名称
    /// </summary>
    [Required(ErrorMessage = "货品名称不能为空")]
    [MaxLength(128, ErrorMessage = "货品名称字符长度不能超过128")]
    public string GoodsName { get; set; }
    
    /// <summary>
    /// 货品类型编号
    /// </summary>
    public long? GoodsTypeId { get; set; }
    
    /// <summary>
    /// 货品规格型号
    /// </summary>
    [MaxLength(128, ErrorMessage = "货品规格型号字符长度不能超过128")]
    public string? GoodsSpecs { get; set; }
    
    /// <summary>
    /// 供应商编号
    /// </summary>
    public long? GoodsSupplierId { get; set; }
    
    /// <summary>
    /// 客户编号
    /// </summary>
    public long? GoodsCustomerId { get; set; }
    
    /// <summary>
    /// 入库参考价/元
    /// </summary>
    public int? GoodsIntoMoney { get; set; }
    
    /// <summary>
    /// 出库参考价/元
    /// </summary>
    public int? GoodsOutMoney { get; set; }
    
    /// <summary>
    /// 货品状态
    /// </summary>
    [Required(ErrorMessage = "货品状态不能为空")]
    public bool? GoodsType { get; set; }
    
    /// <summary>
    /// 保质期管理
    /// </summary>
    [Required(ErrorMessage = "保质期管理不能为空")]
    public bool? GoodsExpiration { get; set; }
    
    /// <summary>
    /// 保质期
    /// </summary>
    [MaxLength(64, ErrorMessage = "保质期字符长度不能超过64")]
    public string? GoodsExpirationNum { get; set; }
    
    /// <summary>
    /// 预警天数
    /// </summary>
    public int? GoodsWarning { get; set; }
    
    /// <summary>
    /// 货品备注
    /// </summary>
    [MaxLength(512, ErrorMessage = "货品备注字符长度不能超过512")]
    public string? GoodsNote { get; set; }
    
    /// <summary>
    /// 货品单位编号
    /// </summary>
    public long? GoodsUnitId { get; set; }
    
    /// <summary>
    /// 货品图片
    /// </summary>
    [MaxLength(512, ErrorMessage = "货品图片字符长度不能超过512")]
    public string? GoodsPic { get; set; }
    
    /// <summary>
    /// 货品仓库编号
    /// </summary>
    public long? GoodsWareId { get; set; }
    
}

/// <summary>
/// 货品表删除输入参数
/// </summary>
public class DeleteGoodsModelInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long Id { get; set; }
    
}

/// <summary>
/// 货品表更新输入参数
/// </summary>
public class UpdateGoodsModelInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long Id { get; set; }
    
    /// <summary>
    /// 货品编码
    /// </summary>    
    [Required(ErrorMessage = "货品编码不能为空")]
    [MaxLength(64, ErrorMessage = "货品编码字符长度不能超过64")]
    public string GoodsCode { get; set; }
    
    /// <summary>
    /// 货品名称
    /// </summary>    
    [Required(ErrorMessage = "货品名称不能为空")]
    [MaxLength(128, ErrorMessage = "货品名称字符长度不能超过128")]
    public string GoodsName { get; set; }
    
    /// <summary>
    /// 货品类型编号
    /// </summary>    
    public long? GoodsTypeId { get; set; }
    
    /// <summary>
    /// 货品规格型号
    /// </summary>    
    [MaxLength(128, ErrorMessage = "货品规格型号字符长度不能超过128")]
    public string? GoodsSpecs { get; set; }
    
    /// <summary>
    /// 供应商编号
    /// </summary>    
    public long? GoodsSupplierId { get; set; }
    
    /// <summary>
    /// 客户编号
    /// </summary>    
    public long? GoodsCustomerId { get; set; }
    
    /// <summary>
    /// 入库参考价/元
    /// </summary>    
    public int? GoodsIntoMoney { get; set; }
    
    /// <summary>
    /// 出库参考价/元
    /// </summary>    
    public int? GoodsOutMoney { get; set; }
    
    /// <summary>
    /// 货品状态
    /// </summary>    
    [Required(ErrorMessage = "货品状态不能为空")]
    public bool? GoodsType { get; set; }
    
    /// <summary>
    /// 保质期管理
    /// </summary>    
    [Required(ErrorMessage = "保质期管理不能为空")]
    public bool? GoodsExpiration { get; set; }
    
    /// <summary>
    /// 保质期
    /// </summary>    
    [MaxLength(64, ErrorMessage = "保质期字符长度不能超过64")]
    public string? GoodsExpirationNum { get; set; }
    
    /// <summary>
    /// 预警天数
    /// </summary>    
    public int? GoodsWarning { get; set; }
    
    /// <summary>
    /// 货品备注
    /// </summary>    
    [MaxLength(512, ErrorMessage = "货品备注字符长度不能超过512")]
    public string? GoodsNote { get; set; }
    
    /// <summary>
    /// 货品单位编号
    /// </summary>    
    public long? GoodsUnitId { get; set; }
    
    /// <summary>
    /// 货品图片
    /// </summary>    
    [MaxLength(512, ErrorMessage = "货品图片字符长度不能超过512")]
    public string? GoodsPic { get; set; }
    
    /// <summary>
    /// 货品仓库编号
    /// </summary>    
    public long? GoodsWareId { get; set; }
    
}

/// <summary>
/// 货品表主键查询输入参数
/// </summary>
public class QueryByIdGoodsModelInput : DeleteGoodsModelInput
{
}

/// <summary>
/// 货品表数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportGoodsModelInput : BaseImportInput
{
    /// <summary>
    /// 货品编码
    /// </summary>
    [ImporterHeader(Name = "*货品编码")]
    [ExporterHeader("*货品编码", Format = "", Width = 25, IsBold = true)]
    public string GoodsCode { get; set; }
    
    /// <summary>
    /// 货品名称
    /// </summary>
    [ImporterHeader(Name = "*货品名称")]
    [ExporterHeader("*货品名称", Format = "", Width = 25, IsBold = true)]
    public string GoodsName { get; set; }
    
    /// <summary>
    /// 货品类型编号
    /// </summary>
    [ImporterHeader(Name = "货品类型编号")]
    [ExporterHeader("货品类型编号", Format = "", Width = 25, IsBold = true)]
    public long? GoodsTypeId { get; set; }
    
    /// <summary>
    /// 货品规格型号
    /// </summary>
    [ImporterHeader(Name = "货品规格型号")]
    [ExporterHeader("货品规格型号", Format = "", Width = 25, IsBold = true)]
    public string? GoodsSpecs { get; set; }
    
    /// <summary>
    /// 供应商编号
    /// </summary>
    [ImporterHeader(Name = "供应商编号")]
    [ExporterHeader("供应商编号", Format = "", Width = 25, IsBold = true)]
    public long? GoodsSupplierId { get; set; }
    
    /// <summary>
    /// 客户编号
    /// </summary>
    [ImporterHeader(Name = "客户编号")]
    [ExporterHeader("客户编号", Format = "", Width = 25, IsBold = true)]
    public long? GoodsCustomerId { get; set; }
    
    /// <summary>
    /// 入库参考价/元
    /// </summary>
    [ImporterHeader(Name = "入库参考价/元")]
    [ExporterHeader("入库参考价/元", Format = "", Width = 25, IsBold = true)]
    public int? GoodsIntoMoney { get; set; }
    
    /// <summary>
    /// 出库参考价/元
    /// </summary>
    [ImporterHeader(Name = "出库参考价/元")]
    [ExporterHeader("出库参考价/元", Format = "", Width = 25, IsBold = true)]
    public int? GoodsOutMoney { get; set; }
    
    /// <summary>
    /// 货品状态
    /// </summary>
    [ImporterHeader(Name = "*货品状态")]
    [ExporterHeader("*货品状态", Format = "", Width = 25, IsBold = true)]
    public bool? GoodsType { get; set; }
    
    /// <summary>
    /// 保质期管理
    /// </summary>
    [ImporterHeader(Name = "*保质期管理")]
    [ExporterHeader("*保质期管理", Format = "", Width = 25, IsBold = true)]
    public bool? GoodsExpiration { get; set; }
    
    /// <summary>
    /// 保质期
    /// </summary>
    [ImporterHeader(Name = "保质期")]
    [ExporterHeader("保质期", Format = "", Width = 25, IsBold = true)]
    public string? GoodsExpirationNum { get; set; }
    
    /// <summary>
    /// 预警天数
    /// </summary>
    [ImporterHeader(Name = "预警天数")]
    [ExporterHeader("预警天数", Format = "", Width = 25, IsBold = true)]
    public int? GoodsWarning { get; set; }
    
    /// <summary>
    /// 货品备注
    /// </summary>
    [ImporterHeader(Name = "货品备注")]
    [ExporterHeader("货品备注", Format = "", Width = 25, IsBold = true)]
    public string? GoodsNote { get; set; }
    
    /// <summary>
    /// 货品单位编号
    /// </summary>
    [ImporterHeader(Name = "货品单位编号")]
    [ExporterHeader("货品单位编号", Format = "", Width = 25, IsBold = true)]
    public long? GoodsUnitId { get; set; }
    
    /// <summary>
    /// 货品图片
    /// </summary>
    [ImporterHeader(Name = "货品图片")]
    [ExporterHeader("货品图片", Format = "", Width = 25, IsBold = true)]
    public string? GoodsPic { get; set; }
    
    /// <summary>
    /// 货品仓库编号
    /// </summary>
    [ImporterHeader(Name = "货品仓库编号")]
    [ExporterHeader("货品仓库编号", Format = "", Width = 25, IsBold = true)]
    public long? GoodsWareId { get; set; }
    
}
